import curses
import time

def refresh_multiline_interface(stdscr, lines):
    stdscr.clear()  # 清除屏幕内容
    for i, line in enumerate(lines):
        stdscr.addstr(i, 0, line)  # 在指定位置添加文本
    stdscr.refresh()  # 刷新屏幕

# 模拟多行界面内容
lines = ["Line 1", "Line 2", "Line 3"]

# 初始化 curses
stdscr = curses.initscr()
curses.curs_set(0)  # 隐藏光标

# 模拟多行界面的更新
for i in range(5):
    # 模拟处理过程
    time.sleep(1)
    
    # 更新界面内容
    updated_lines = [f"{i: 05} {line} - Updated" for line in lines]
    refresh_multiline_interface(stdscr, updated_lines)

# 结束 curses
curses.endwin()